package com.ysd.resourceusestatistics.controller;

import javax.annotation.Resource;

import com.ysd.resourceusestatistics.model.User;
import com.ysd.resourceusestatistics.service.IUserService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@ApiOperation("用户登录")
@RestController
@RequestMapping("/user")
public class UserController {
@Resource
private IUserService userService;


    
        
        @ApiOperation(value = "登录",notes ="登录" )
        @ApiImplicitParams({
            
            @ApiImplicitParam(name ="userName",value = "用户名",required = true,paramType = "path"),
            @ApiImplicitParam(name ="password",value = "密码",required = true,paramType = "path")
        })
        @GetMapping(value = "/{uname}/{upass}")
        public User login(@PathVariable String userName, @PathVariable String password) {
            
            return userService.findByUnameAndPass(userName,password);
            
        }



}